const directToPage = (navigation, pageName, params) => {
    return navigation.navigate(pageName, params);
}

const filterFieldData = (courseData, field, doSize) => {
    const _data = courseData.filter((item, index) => {
        if(item.field === 'all') {
            return true;
        }

        return item.field === field;
    });

    return doSlice ? _data.slice(0,4) : _data
}

export {
    directToPage,
    filterFieldData
};